package cn.iocoder.yudao.module.shop.statistics.service;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.shop.statistics.dal.dataobject.ShopStatisticsDO;
import cn.iocoder.yudao.module.shop.statistics.dal.mysql.ShopStatisticsMapper;
import cn.iocoder.yudao.module.shop.statistics.vo.ShopStatisticsRespVO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import java.time.LocalDate;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2024/11/28
 */
@Service
@Validated
public class ShopStatisticsServiceImpl implements ShopStatisticsService {
    @Resource
    private ShopStatisticsMapper shopStatisticsMapper;

    @Override
    public ShopStatisticsRespVO getStatistics(Long shopId, LocalDate date) {
        ShopStatisticsDO statisticsDO = shopStatisticsMapper.selectByShopIdAndDate(shopId, date);
        return BeanUtils.toBean(statisticsDO, ShopStatisticsRespVO.class);
    }

}
